function doCancel(){
  return true;
}
function doOnLoad(){
  var retVals = window.arguments[0];
  document.getElementById('txtName').value = retVals.name;
  var inputBox = document.getElementById("txtViewpointName");
  inputBox.focus();
}

function doOK(){
	var stringBundle = document.getElementById("sbLasuli");
  var topicName = document.getElementById('txtName').value;
  if('undefined' == typeof topicName || topicName == ""){
    alert(stringBundle.getString("topicDialog.error.nameisnull"));
    return false;
  }
  var setting = getCurrentSetting();
  var defaultService = setting.hypertopic.url;
  var user = setting.hypertopic.url;
  var pass = setting.hypertopic.url;
  var retVals = window.arguments[0];
  var uri = retVals.uri;
  var topic = new Topic();
  topic.name = topicName;
  topic.viewpoint.href = uri.substr(0, uri.indexOf("/topic/")+1);
  var res = topic.httpPost(uri, user, pass);
  if(res == null){
    alert(stringBundle.getString("topicDialog.error.servererror"));
    return false;
  }

  retVals.newName  = topicName;
  return true;
}